package com.example.socialwebserver.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.socialwebserver.mapper.ExpectFriendMapper;
import com.example.socialwebserver.pojo.ExpectFriendDAO;
import com.example.socialwebserver.service.ExpectFriendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class ExceptFriendServiceImpl implements ExpectFriendService {
    @Autowired
    ExpectFriendMapper expectFriendMapper;
    @Override
    public ExpectFriendDAO SelectById(Integer id) {
        return expectFriendMapper.selectById(id);
    }
    @Override
    public boolean InsertExFrDAO(ExpectFriendDAO expectFriendDAO) {
        return expectFriendMapper.insert(expectFriendDAO) == 1?true:false;
    }
    @Override
    public boolean UpdateById(ExpectFriendDAO expectFriendDAO) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("id", expectFriendDAO.getId());
        return expectFriendMapper.update(expectFriendDAO,queryWrapper) == 1?true:false;
    }
    @Override
    public boolean DeleteById(Integer id) {
        return expectFriendMapper.deleteById(id) == 1?true:false;
    }
}
